<?php 
	include("php/header.php");
	include("php/db.php");
	?>
	<h1>Kamera-Pi</h1>
	
<?php

  $cams = mysqli_query($db, "SELECT * FROM t_cams");
  print "<table>";
  while($row = mysqli_fetch_object($cams))
  {
    print "<tr><td>";
    print $row->cam_id;
    print "</td><td>";
    print $row->cam_ip;
    print "</td><td>";
    print $row->cam_name;
    print "</td></tr>";
  }
  print "</table>";

?>
<form action="managecam.php" method="post">
  <table>
    <tr>
      <td>
	<input type="text" name="ip" placeholder="192.168.1.x" />
      </td>
      <td>
	<input type="text" name="camname" placeholder="Name" />
      </td>
      <td>
	<input type="submit" value="Hinzufügen" />
      </td>
    </tr>
  </table>
</form>

<p><a href="../../cgi-bin/startcam.cgi">startcam</a></p>
<p><a href="../../cgi-bin/stopcam.cgi">stopcam</a></p>
<p><a href="../../cgi-bin/copy.cgi">copy</a></p>

<p><a href="../../cgi-bin/show.cgi">show</a></p>	
	
<?php include ("php/footer.php"); ?>